package io.zso.controller;

import io.zso.commons.tools.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("ping")
public class TController {
    @Autowired
    private MongoTemplate mongoTemplate;

    @GetMapping("mongo")
    public Result page() {
        Query query = new Query();
        List<Object> list = mongoTemplate.find(query, Object.class, "vp_vendor_type");
        System.out.println(list);
        return new Result<List<Object>>().ok(list);
    }
}